var app = getApp();
Page({
  data: {
    imgUrls: [],
    indicatorDots:true,
    autoplay: false,
    duration: 500,
    circular:true,
    getMachineList:[],
    img_url: app.globalData.imgurl,
  },
  navto:function(e){
    console.log(e.currentTarget.dataset.machineId);
    app.globalData.machine_id = e.currentTarget.dataset.machineId;
    wx.navigateTo({
      url: "../show/show?machine_id=" + app.globalData.machine_id
    })
  },
  onLoad:function(){
    var that=this;
    wx.request({
      url: app.globalData.api_url + '/OpenAPI/v1/ToyMachine/getMachineList',
      data: {
        page:1
      },
      method:'GET',
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res.data)
        that.setData({
          getMachineList: res.data.data.list,
        })
      },
      fail:function(res){
        console.log(res.data)
      }
    })
    wx.request({
      url: app.globalData.api_url + '/OpenAPI/v1/app/banner',
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res.data)
        that.setData({
          imgUrls: res.data.data,
        })
      },
      fail: function (res) {
        console.log(res.data)
      }
    })
  },
  onReady: function () {
    
  }
})
